import com.beans.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
//        UserController4 controller4 = context.getBean("userController4",UserController4.class);
//        controller4.sayHi();
        BeanScope1 beanScope1 = context.getBean(BeanScope1.class);
        User user1 = beanScope1.getUser();
        System.out.println("BeanScope1: " + user1);

        BeanScope2 beanScope2 = context.getBean(BeanScope2.class);
        User user2 = beanScope2.getUser();
        System.out.println("BeanScope2: " + user2);
//        UserService service = context.getBean("userService",UserService.class);
//        service.sayHi();
//        UserRepository repository = context.getBean(UserRepository.class);
//        repository.sayHi();
//        UserConfig config = context.getBean(UserConfig.class);
//        config.sayHi();
//        UserComponent component = context.getBean(UserComponent.class);
//        component.sayHi();
//        APIController controller = context.getBean("APIController",APIController.class);
//        controller.sayHi();
//        User user = context.getBean("hu",User.class);
//        System.out.println(user);



    }
}
